/*
 * AbstractFile.java
 *
 * Created on December 10, 2006, 5:32 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package eu.somatik.somaftp.logic;

/**
 *
 * @author francisdb
 */
public abstract class AbstractFile implements FileInterface{
   
    

    
    public int compareTo(FileInterface o) {
        if(this.isDirectory()){
            if(o.isDirectory()){
                return this.getName().compareToIgnoreCase(o.getName());
            }else{
                return -1;
            }
        }else{
            if(o.isDirectory()){
                return 1;
            }else{
                return this.getName().compareToIgnoreCase((o.getName()));
            }
        }
    }

    
}
